Every lens lies, and in exactly three ways. Straight lines bow. The corners come out darker than the middle. And red and blue light land at slightly different sizes, so a lens is really three lenses that nearly agree, and the disagreement shows as a coloured fringe on every hard edge.

These are honest lies: the same lens tells the same ones every time, and someone has usually written them down. The trouble is that several someones have. The camera may have fixed its own picture before saving it. Apple's RAW decoder may straighten the file as it develops it. And Lensfun, an open database of measured lenses, has a page for the lens by name: how far it bends at each focal length, how fast it darkens at each aperture.

Three witnesses is one too many. Straighten a line twice and it bows the other way, which is not a correction so much as a change of opinion. So the rule is one source per lie, and never two for distortion. A finished JPEG gets nothing more: every camera we know of straightens its own before saving it. A RAW gets Apple's decoder for the bend, if it offers one, and the database for the darkening and the fringes. A telescope gets nothing: the stars were never bent, only everything else.

One point of order. The database measured the darkening on the bent picture, so once the bend is undone the corners aren't where they were measured. Each correction is read back through the lens's own distortion to find where the measurement really was.

If the camera already told the truth, we don't make it tell it twice.
